/**************************************************************************************
*
*	Copyright (C) 2009 - 2012 Brent Andrew O. Chua - See LICENSE.txt for more info.
*		
*	Filename	-	EventModelLoaded.cpp
*
*	Comments	-	See EventModelLoaded.h
*
**************************************************************************************/
#include "../Include/EventModelLoaded.h"
#include "../Include/Model.h"

namespace Pulse
{
	EventModelLoaded::EventModelLoaded( void ) 
		: m_pModel( PSX_NULL )
	{
	}

	EventModelLoaded::~EventModelLoaded( void )
	{
		ReleaseModel();
	}

	void EventModelLoaded::SetModel( Model *pModel )
	{
		ReleaseModel();

		m_pModel = pModel;

		if ( pModel )
		{
			pModel->AddRef();
		}
	}

	Model * EventModelLoaded::GetModel( void )
	{
		if ( m_pModel )
		{
			m_pModel->AddRef();
		}

		return m_pModel;
	}

	void EventModelLoaded::ReleaseModel( void )
	{
		PSX_SafeRelease( m_pModel );
	}

}